{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "3c2f0e66",
   "metadata": {},
   "source": [
    "# 第一步 引入模块"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "id": "e37b195f",
   "metadata": {},
   "outputs": [],
   "source": [
    "import fiftyone as fo\n",
    "import fiftyone.zoo as foz"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "00270a78",
   "metadata": {},
   "source": [
    "# 第二步 应用模块"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "id": "aefe94f6",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Downloading split 'validation' to 'persondata\\validation' if necessary\n",
      "Downloading annotations to 'persondata\\tmp-download\\annotations_trainval2017.zip'\n",
      " 100% |██████████████████████████████████████████████|    1.9Gb/1.9Gb [3.5m elapsed, 0s remaining, 8.1Mb/s]         \n",
      "Extracting annotations to 'persondata\\raw\\instances_val2017.json'\n",
      "Downloading 2693 images\n",
      " 100% |████████████████| 2693/2693 [4.9m elapsed, 0s remaining, 4.2 images/s]      \n",
      "Writing annotations for 2693 downloaded samples to 'persondata\\validation\\labels.json'\n",
      "Dataset info written to 'persondata\\info.json'\n",
      "Ignoring unsupported parameter 'num_worker' for importer type <class 'fiftyone.utils.coco.COCODetectionDatasetImporter'>\n",
      "Ignoring unsupported parameter 'dadaset_name' for importer type <class 'fiftyone.utils.coco.COCODetectionDatasetImporter'>\n",
      "Loading 'coco-2017' split 'validation'\n",
      " 100% |███████████████| 2693/2693 [6.3s elapsed, 0s remaining, 465.0 samples/s]      \n",
      "Dataset 'coco-2017-validation' created\n"
     ]
    }
   ],
   "source": [
    "dataset = foz.load_zoo_dataset(\n",
    "\"coco-2017\",\n",
    "split = \"validation\",\n",
    "label_types = [\"detections\"],\n",
    "classes = [\"person\"],\n",
    "only_matching = True,\n",
    "num_worker=8,\n",
    "dataset_dir = \"persondata\",\n",
    "dadaset_name = \"open-c\",\n",
    ")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "ed10c230",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "nmsl",
   "language": "python",
   "name": "nmsl"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.9.18"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
